/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.util.Comparator;
import java.util.Date;

/**
 *
 * @author fightfxj
 */
public class DetailTimeComparator implements Comparator <Detail>{

    @Override
    public int compare(Detail o1, Detail o2) {
        try {
            String si = o1.getDetailInfo().getValue("收支日期").getString();
            String sj = o2.getDetailInfo().getValue("收支日期").getString();
            Date Di = configure.Global.sdf.parse(si);
            Date Dj = configure.Global.sdf.parse(sj);
            return Di.compareTo(Dj);
        } catch (Exception e) {
            System.out.println("Exception in compare of DetailTimeComparator");
            return 0;
        }
        
    }

}
